using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Model=Auto.Data.BusMan.Model;
using Auto.Data.BusMan.DALFactory;
using Auto.Data.BusMan.IDAL;
using Auto.Data.DBUtility;  //Please Add Reference First
namespace Auto.Data.BusMan.BLL
{
            /// <sumary> 
            /// BLL SecruityAnalysisMeeting 
            /// </sumary> 
	public class SecruityAnalysisMeeting
	{
	  private readonly ISecruityAnalysisMeeting dal=DataAccess<ISecruityAnalysisMeeting>.CreateDALInstance("SecruityAnalysisMeeting");
	  #region --New--
            /// <sumary> 
            /// Constructed Function 
            /// </sumary> 
	  public SecruityAnalysisMeeting()
	  {
	  }
            /// <sumary> 
            /// Get Model 
            /// </sumary> 
            /// <param name="objKey">Key Of Table</param> 
            /// <returns>SecruityAnalysisMeeting</returns> 
	  public Model.SecruityAnalysisMeeting GetModel(string docid )
	  {
	     return dal.GetModel(docid);
	  }
	   /// <summary>
	   /// Get Model, From Cache
	   /// </summary>
	   public SecruityAnalysisMeeting GetModelByCache(string docid)
	   {
	       string CacheKey = "SecruityAnalysisMeetingModel-"+docid;
	       object objModel = Auto.Components.DataCache.GetCache(CacheKey);
	       if (objModel == null)
	       {
	         try
	         {
	           objModel = dal.GetModel(docid);
	           if (objModel != null)
	           {
	             int ModelCache = Auto.Components.ConfigHelper.GetConfigInt("ModelCache");
	             Auto.Components.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
	            }
	         }
	        catch{}
	        }
	      return (SecruityAnalysisMeeting)objModel;
	   }
	 #endregion --New--
	 #region--Operate--
	  /// <summary>
	  /// Is Exists Or Not
	  /// </summary>
	  public bool Exists(string docid )
	  {
	     return dal.Exists(docid);
	  }
	 #endregion--Operate--
	  #region --SQL--
	  /// <summary>
	  /// Add One Record
	  /// </summary>
	  public void Add(Model.SecruityAnalysisMeeting model)
	  {
	     dal.Add(model);
	  }
	  /// <summary>
	  /// Update One Record
	  /// </summary>
	  public void  Update(Model.SecruityAnalysisMeeting model)
	  {
	     dal.Update(model);
	  }
	  /// <summary>
	  /// Delete One Record
	  /// </summary>
	  public void  Delete(string docid )
	  {
	     dal.Delete(docid);
	  }
	 #endregion --SQL--
	 #region --Get Data--
            /// <sumary> 
            ///  Get Data By Primary Key 
            /// </sumary> 
	 /// <returns>DataTable</returns>
	  public DataTable GetDataByKeyValue(string docid)
	  {
	     return dal.GetDataByKeyValue(docid);
	  }
	  /// <summary>
	  /// Get Data List
	  /// </summary>
	 /// <param name="strWhere">strWhere Format: ColName1='?' AND ColName2='?'...</param>
	  public DataTable GetList(string strWhere)
	  {
	     return dal.GetList(strWhere);
	  }
	 /// <summary>
	 /// Get Top N Datalist
	 /// </summary>
	 /// <param name="top">Top Rows</param>
	 /// <param name="strWhere">strWhere Format: ColName1='?' AND ColName2='?'...</param>
	 /// <param name="fieldOrder">ORDER BY FIELD,Format: ColName1,ColName2...ASC</param>
	 public DataTable GetList(int top,string strWhere,string fieldOrder)
	 {
	   return dal.GetList(top,strWhere,fieldOrder);
	 }
	 /// <summary>
	 /// Get Model List<SecruityAnalysisMeeting>
	 /// </summary>
	 /// <param name="strWhere">strWhere Format: ColName1='?' AND ColName2='?'...</param>

	 public List<Model.SecruityAnalysisMeeting> GetModelList(string strWhere)
	 {
	 DataTable dt = dal.GetList(strWhere);
	 return DataTableToList(dt);
	 }
	 /// <summary>
	 /// GetMoelList By Table
	 /// </summary>
	 public List<Model.SecruityAnalysisMeeting> DataTableToList(DataTable dt)
	 {
	 List<Model.SecruityAnalysisMeeting> modelList = new List<Model.SecruityAnalysisMeeting>();
	 modelList = dal.DataTableToList(dt);
	 return modelList;
	 }
	  /// <summary>
	  /// Get ALL LIST
	  /// </summary>
	  public DataTable GetAllList()
	  {
	     return dal.GetList("");
	  }
	  ///// <summary>
	  ///// Get Data By Pages
	  ///// </summary>
	  //public DataSet GetList(int pageSize,int pageIndex,string strWhere)
	  //{
	  //  return dal.GetList(pageSize,pageIndex,strWhere);
	  //}
	  #endregion --Get Data--
	}
}
